<test>
  <sql>WITH LondonEmployees AS (
	SELECT	*
	FROM	Employees e
	WHERE	e.City = 'London'
), LondonEmployees2 AS (
	SELECT	*
	FROM	Employees e
	WHERE	e.City = 'London'
)
SELECT	le.FirstName,
		le.LastName
FROM	LondonEmployees le
WHERE	le.EmployeeId &gt; 5
ORDER   BY 1, 2</sql>
  <expectedResults>
	  <NewDataSet>
		  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
			  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Table1" msdata:UseCurrentLocale="true">
				  <xs:complexType>
					  <xs:choice minOccurs="0" maxOccurs="unbounded">
						  <xs:element name="Table1">
							  <xs:complexType>
								  <xs:sequence>
									  <xs:element name="FirstName" type="xs:string" minOccurs="0" />
									  <xs:element name="LastName" type="xs:string" minOccurs="0" />
								  </xs:sequence>
							  </xs:complexType>
						  </xs:element>
					  </xs:choice>
				  </xs:complexType>
			  </xs:element>
		  </xs:schema>
		  <Table1>
			  <FirstName>Anne</FirstName>
			  <LastName>Dodsworth</LastName>
		  </Table1>
		  <Table1>
			  <FirstName>Michael</FirstName>
			  <LastName>Suyama</LastName>
		  </Table1>
		  <Table1>
			  <FirstName>Robert</FirstName>
			  <LastName>King</LastName>
		  </Table1>
	  </NewDataSet>
  </expectedResults>
  <expectedPlan>
    <executionPlan>
      <element operator="Select">
        <properties>
          <property name="Output List.[0]" value="e.FirstName AS FirstName" />
          <property name="Output List.[0].Table" value="e" />
          <property name="Output List.[0].Column" value="FirstName" />
          <property name="Output List.[0].DataType" value="String" />
          <property name="Output List.[0].Output Name" value="FirstName" />
          <property name="Output List.[1]" value="e.LastName AS LastName" />
          <property name="Output List.[1].Table" value="e" />
          <property name="Output List.[1].Column" value="LastName" />
          <property name="Output List.[1].DataType" value="String" />
          <property name="Output List.[1].Output Name" value="LastName" />
        </properties>
        <input>
          <element operator="Sort">
            <properties>
              <property name="Output List.[0]" value="e.LastName" />
              <property name="Output List.[0].Table" value="e" />
              <property name="Output List.[0].Column" value="LastName" />
              <property name="Output List.[0].DataType" value="String" />
              <property name="Output List.[1]" value="e.FirstName" />
              <property name="Output List.[1].Table" value="e" />
              <property name="Output List.[1].Column" value="FirstName" />
              <property name="Output List.[1].DataType" value="String" />
              <property name="Statistics.Open Count" value="1" />
              <property name="Statistics.Row Count" value="3" />
              <property name="Statistics.Average Row Count" value="3" />
              <property name="Logical Operator" value="Sort" />
              <property name="Order By.[0]" value="e.FirstName ASC" />
              <property name="Order By.[0].Table" value="e" />
              <property name="Order By.[0].Column" value="FirstName" />
              <property name="Order By.[0].DataType" value="String" />
              <property name="Order By.[0].Order" value="ASC" />
              <property name="Order By.[1]" value="e.LastName ASC" />
              <property name="Order By.[1].Table" value="e" />
              <property name="Order By.[1].Column" value="LastName" />
              <property name="Order By.[1].DataType" value="String" />
              <property name="Order By.[1].Order" value="ASC" />
            </properties>
            <input>
              <element operator="Filter">
                <properties>
                  <property name="Output List.[0]" value="e.LastName" />
                  <property name="Output List.[0].Table" value="e" />
                  <property name="Output List.[0].Column" value="LastName" />
                  <property name="Output List.[0].DataType" value="String" />
                  <property name="Output List.[1]" value="e.FirstName" />
                  <property name="Output List.[1].Table" value="e" />
                  <property name="Output List.[1].Column" value="FirstName" />
                  <property name="Output List.[1].DataType" value="String" />
                  <property name="Statistics.Open Count" value="1" />
                  <property name="Statistics.Row Count" value="3" />
                  <property name="Statistics.Average Row Count" value="3" />
                  <property name="Predicate" value="e.EmployeeID &gt; 5 AND e.City = 'London'" />
                </properties>
                <input>
                  <element operator="TableScan">
                    <properties>
                      <property name="Table" value="Employees AS e" />
                      <property name="Output List.[0]" value="e.EmployeeID" />
                      <property name="Output List.[0].Table" value="e" />
                      <property name="Output List.[0].Column" value="EmployeeID" />
                      <property name="Output List.[0].DataType" value="Int32" />
                      <property name="Output List.[1]" value="e.LastName" />
                      <property name="Output List.[1].Table" value="e" />
                      <property name="Output List.[1].Column" value="LastName" />
                      <property name="Output List.[1].DataType" value="String" />
                      <property name="Output List.[2]" value="e.FirstName" />
                      <property name="Output List.[2].Table" value="e" />
                      <property name="Output List.[2].Column" value="FirstName" />
                      <property name="Output List.[2].DataType" value="String" />
                      <property name="Output List.[3]" value="e.City" />
                      <property name="Output List.[3].Table" value="e" />
                      <property name="Output List.[3].Column" value="City" />
                      <property name="Output List.[3].DataType" value="String" />
                      <property name="Statistics.Open Count" value="1" />
                      <property name="Statistics.Row Count" value="9" />
                      <property name="Statistics.Average Row Count" value="9" />
                    </properties>
                    <input />
                  </element>
                </input>
              </element>
            </input>
          </element>
        </input>
      </element>
    </executionPlan>
  </expectedPlan>
</test>